Automatic Program Generation from Specifications Using Prolog
نویسندگان
چکیده
This paper describes an automatic program generator which creates PROLOG programs from input/output specifications. The generator takes as input descriptions of the input and output data types, a set of tests, a set of transformations and the input/output relation. Abstract data types are used as models for data. They are defined as sets of terms satisfying a system of equations. The tests, the transformations and the input/output relation are also specified by equations. The program generator creates a PROLOG program which takes as input a data item, iteml, of the input data type and outputs a data item, item2, of the output data type such that the input/output relation is satisfied by the pair iteml,item2. In building the program the generator uses only the tests and the transformations given as input. The program generator was writen in PROLOG. It was able to generate correct PROLOG programs for sorting lists with and without eliminating duplicate elements. The system contains specifications of the abstract data types natural number, boolean, list and array. The system can be used in two modes: in the first mode the user defines his/her own data types and in the second mode he/she uses the definitions that are already in the system library. A user interface is being constructed for the second class of users. The paper also presents several methods for validating the input/output specifications. Some of them were implemented in the system. Descriptions of the heuristics employed by the program synthesizer are also included. Finally, the paper compares this system with the approaches taken by other researchers in automatic program generation : Prywes, Manna and Dershowitz.
منابع مشابه
Partial Specifications of Program Properties
For the automatic revision of homework assignments in Prolog programming courses, in general one has to rely on testing or on validating programs with respect to a specification. Here, we present a pragmatic and flexible method for the partial specification of program properties. Within the AT(P) system, partial specifications can be used for automatic analysis of student solutions to Prolog ex...
متن کاملA tool to check operational properties of Prolog programs with application to program construction and program optimization – Tool demonstration
We present a tool, based on abstract interpretation, that checks the correctness of an annotated Prolog program with respect to formal specifications of its procedures. Specifications describe operational properties such as mode, type, sharing, linearity, and size of input/output terms, occur-check freeness, conditions for sure success and failure, number of solutions to a call, including deter...
متن کاملAn Automatic Off-Line Feature Interaction Detection Method by Static Analysis of Specifications
This paper presents an automatic off-line method for detecting interactions from service specifications. Services are specified with diagrams. The detection is based on a static analysis and reveals two main kinds of interactions : when two services are triggered at the same time or when the trigger of a service leads to the trigger of another one. It is implemented in Prolog and we present a c...
متن کاملOn the Automatic Generation of Events in Delta Prolog
Delta Prolog is a concurrent logic programming language, which extends Prolog with AND-parallelism. Communication and synchronization between parallel processes is established by using special control structures: event goals. To relieve the programmer from inserting these structures at the correct program points, we propose a method for automatically generating them, departing from a Prolog pro...
متن کاملGeneration of and Debugging with Logical Pre and Postconditions
This paper shows the debugging facilities provided by the SLAM system. The SLAM system includes i) a specification language that integrates algebraic specifications and model-based specifications using the object oriented model. Class operations are defined by using rules each of them with logical pre and postconditions but with a functional flavour. ii) A development environment that, among ot...
متن کامل